import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import UserList from '@/components/UserList.vue'
const routes =[
  {
    path: '/',
    name: '首页',
    component: HomeView,
    meta:{
      showInMenu:true
    }
  },
  {
    path: '/userList',
    name: '用户列表',
    component: UserList,
    meta:{
      showInMenu:true
    }
  },
  {
    path: '/about',
    name: '关于',
    // route level code-splitting
    // this generates a separate chunk (About.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import('../views/AboutView.vue'),
    meta:{
      showInMenu:true
    }
  }
]
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: routes
})

export default router
export {routes}
